package com.tiancai.pojo.vo;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 *
 * </p>
 *
 * @author tiancai
 * @since 2025-03-11
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CommentVo implements Serializable {



    /**
     * id
     */

    @Schema(description = "id")
    private Long id;

    /**
     * 评论人id
     */
    @Schema(description = "评论人id")
    private Long userId;
    /**
     * 评论人姓名
     */
    @Schema(description = "评论人姓名")
    private String username;
    /**
     * 评论人头像
     */
    @Schema(description = "评论人头像")
    private String userAvatar;

    /**
     * 评论的作品id
     */
    @Schema(description = "评论的作品id")
    private Long workId;

    /**
     * 评论内容
     */
    @Schema(description = "评论内容")
    private String content;

    /**
     * 点赞数
     */
    @Schema(description = "点赞数")
    private Integer likes;

    /**
     * 创建时间
     */

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill= FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 母评论的id，0-没有母评论
     */
    @Schema(description = "母评论的id，0-没有母评论")
    private Long commentId;

    /**
     * 是否点赞
     */
    @Schema(description = "是否点赞")
    @JsonProperty("isLiked")
    private boolean isLiked;

}
